home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 March / EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso / earcd / comm2 / admail.lha / Install_ADMail < prev    next >
Text File  |  1995-12-21  |  12KB  |  383 lines

  1. ; $VER: ADMail Install Script 1.2 (17.12.95)
  2. ; by Simon Brown
  3.  
  4. ; == Initialize ===========================================================
  5.  
  6. (set appname "ADMail")
  7. (set doc-name "ADMail.guide")
  8. ; == Help Text ============================================================
  9.  
  10. (set #AskFile-help      (cat    "\n  · Use the file requester to select the location\n"
  11.                                 "    on on your hard-disk, where the file resides.\n" ))
  12.  
  13. (set #AskDir-help       (cat    "\n  · Use the requester to select the location (the\n"
  14.                                 "    directory, or partition) where the files(s)\n"
  15.                                 "    should be placed.\n\n"))
  16.  
  17. (set #Main-help         (cat    "\n  · This section of the installation deals with\n"
  18.                                 "    copying the main ADMail executable.\n"
  19.                                 "    The file will be copied to the location\n"
  20.                                 "    previously specified.\n\n"
  21.                                 "  · You are provided with information concerning\n"
  22.                                 "    the version of your current copy (if you have one),\n"
  23.                                 "    in order to ensure you don't accidently overwrite\n"
  24.                                 "    a newer version.\n" ))
  25.  
  26. (set #GuideViewer-help  (cat    "\n  · Select from the list, the viewer you use to\n"
  27.                                 "      display AmigaGuide documents.\n\n"
  28.                                 "  · If the one you use is not listed, select\n"
  29.                                 "    \"Other...\".  You will then be asked to select\n"
  30.                                 "    the one you use.\n" ))
  31.  
  32. (set #Config-help       (cat    "\n  · Fill in the value you require for the option\n"
  33.                                 "    you are being prompted for. Check the guide\n"
  34.                                 "    for more information on each setting.\n\n"
  35.                                 "  · If you don't want to specify a value, accept\n"
  36.                                 "    the displayed default.\n" ))
  37.  
  38. (set #Makedir-help      (cat    "\n  · A user directory can be created for you under\n"
  39.                                 "    the base directory. This directory is where\n"
  40.                                 "    the user configuration file will be kept, and\n"
  41.                                 "    is also the default location for the .signature\n"
  42.                                 "    and header files.\n"
  43.                                 "  · If you answer Yes, you'll be asked to confirm the\n"
  44.                                 "    directory name, the directory will be created\n"
  45.                                 "    (if it does not already exist) and an empty\n"
  46.                                 "    configuration file placed within.\n" ))
  47.  
  48. (set #Userid-help       (cat    "\n  · The base directories for all settings have\n"
  49.                                 "    been configured. This last option allows you\n"
  50.                                 "    to specify the name of your home directory.\n"
  51.                                 "    The default should hopefully be correct,\n"
  52.                                 "    but if not you can enter a new name here.\n"))
  53.  
  54. ; == Prompt Text ==========================================================
  55.  
  56. (set #MainLoc-prompt            "Select location for main program file...\n" )
  57. (set #IconLoc-prompt            "Select location for script & icon...\n")
  58. (set #DocLoc-prompt             "Select location for documentation...\n" )
  59.  
  60. (set #GuideViewer-prompt        "Which AmigaGuide viewer?\n" )
  61.  
  62. (set #CopyMain-prompt               "Copying executable...\n" )
  63. (set #CopyGuide-prompt              "Copying documentation...\n")
  64.  
  65. ; == Config file prompts ==================================================
  66.  
  67. (set #basedir-prompt (cat       "\nGive the path to the directory you wish to use for\n"
  68.                                 "the base directory. This will be represented as\n"
  69.                                 "$BASEDIR in all other directory settings.\n"))
  70.  
  71. (set #maildir-prompt (cat       "\nGive the path to the directory where the mailboxes\n"
  72.                                 "are stored.\n"))
  73.  
  74. (set #editor-prompt (cat        "\nGive the name of your favourite text editor -\n"
  75.                                 "include any command line options you think you might need.\n"))
  76.  
  77. (set #sendmail-prompt (cat      "\nGive the name of the program you use to send mail -\n"
  78.                                 "include required command line options, and also\n"
  79.                                 "include \"$MSG\" to indicate the message filename.\n"))
  80.  
  81. (set #makedir-prompt (cat       "\nWould you like a user directory to be created?\n"))
  82.  
  83. (set #userid-prompt (cat        "\nGive the name of the user directory to create.\n"))
  84.  
  85. ; == Config file defaults =================================================
  86.  
  87. (set #def-basedir               "USR:")
  88. (set #def-maildir               "$BASEDIR/Mail")
  89. (set #def-editor                "$Editor")
  90. (set #def-sendmail              "sendmail <$MSG -f $USER")
  91. ; == Miscellaneous Text ===================================================
  92.  
  93. (set #Welcome-msg
  94.                         (cat    "\nADMAIL INSTALLATION SCRIPT\n\n"
  95.                                 "Thank you for choosing\n"
  96.                                 "ADMail, Amazing Developments Mail.\n"
  97.                                 "\nThis installation script will copy all\n"
  98.                                 "necessary files to your hard-disk,\n"
  99.                                 "and enable you to set the basic\n"
  100.                                 "configuration for your system.\n\n"
  101.                                 "You are advised to have the docs handy,\n"
  102.                                 "if you wish to set any options.\n\n"
  103.                                 ))
  104.  
  105. (set #bad-kick
  106.     (cat "ADMail requires Kickstart 2.04 or greater to run."))
  107. ; == Check KS version =====================================================
  108.  
  109. (if (< (/ (getversion) 65536) 37)
  110.     (
  111.         (abort #bad-kick)
  112.     )
  113. )
  114.  
  115. (set wbversion (/ (getversion "libs:version.library") 65536))
  116.  
  117. ; == Give Welcome message =================================================
  118.  
  119. (message #Welcome-msg)
  120. (welcome)
  121.  
  122. ; == Install the Main Files ===============================================
  123.  
  124. ; Where should I copy the new main files to?
  125.  
  126. (complete 0)
  127.  
  128. (set !MainLocation
  129.     (askdir
  130.         (prompt #MainLoc-prompt)
  131.         (help #AskDir-help)
  132.         (disk)
  133.         (default "SYS:C")
  134.     )
  135. )
  136.  
  137. (set @default-dest !MainLocation)
  138.  
  139. (copylib
  140.     (prompt #CopyMain-prompt)
  141.     (help #Main-help)
  142.     (source "ADMail")
  143.     (dest !MainLocation)
  144.     (confirm)
  145. )
  146.  
  147. (complete 25)
  148.  
  149. ; Where should I put the icon?
  150.  
  151. (set !IconLocation
  152.     (askdir
  153.         (prompt #IconLoc-prompt)
  154.         (help #AskDir-help)
  155.         (disk)
  156.         (default !MainLocation)
  157.     )
  158. )
  159.  
  160. (delete "Read_Mail")
  161.  
  162. (textfile
  163.     (dest "Read_Mail")
  164.     (append (tackon !MainLocation appname))
  165.     (append "\nendcli\n")
  166. )
  167.  
  168. (copyfiles
  169.     (prompt #Main-prompt)
  170.     (source "Read_Mail")
  171.     (dest !IconLocation)
  172.     (infos)
  173. )
  174.  
  175. (complete 50)
  176.  
  177. ; == Install Documentation ================================================
  178.  
  179. ; Where do they want the docs?
  180.  
  181. (set !DocLocation
  182.     (askdir
  183.         (prompt #DocLoc-prompt)
  184.         (help #AskDir-help)
  185.         (default !MainLocation)
  186.         (disk)
  187.     )
  188. )
  189.  
  190. (set !GuideViewer
  191.     (askchoice
  192.         (prompt #GuideViewer-prompt)
  193.         (help #GuideViewer-help)
  194.         (choices
  195.             "MultiView"
  196.             "AmigaGuide"
  197.             "Other..."
  198.         )
  199.         (default (if (>= wbversion 39) 0 1)
  200.         )
  201.     )
  202. )
  203.  
  204. (if (= !GuideViewer 0) (set !GuideViewer "MultiView"))
  205. (if (= !GuideViewer 1) (set !GuideViewer "AmigaGuide"))
  206. (if (= !GuideViewer 2)
  207.     (set !GuideViewer
  208.         (askfile
  209.             (prompt #GuideViewer-prompt)
  210.             (help #AskFile-help)
  211.             (default "SYS:")
  212.         )
  213.     )
  214. )
  215.  
  216. (copyfiles
  217.     (prompt #CopyGuide-prompt)
  218.     (source doc-name)
  219.     (dest !DocLocation)
  220.     (infos)
  221. )
  222.  
  223. (tooltype
  224.     (dest (tackon !DocLocation doc-name))
  225.     (setdefaulttool !GuideViewer)
  226. )
  227.  
  228. (copyfiles
  229.     (prompt #CopyGuide-prompt)
  230.     (source "AFD-Copyright")
  231.     (dest !DocLocation)
  232. )
  233. (complete 70)
  234.  
  235. (set !BaseConfig
  236.     (askbool
  237.         (prompt "\n\nDo you wish to set the base configuration?")
  238.         (help "\n\nThis will set up the ENV:ADMail.config file,\n"
  239.             "and copy it to ENVARC: for future use. The base\n"
  240.             "configuration file holds defaults for all the users\n"
  241.             "on your system, and also needs to be set up if you\n"
  242.             "want a base directory other than USR:.\n")
  243.         (default 1)
  244.     )
  245. )
  246.  
  247. (set #basedir
  248. )
  249.  
  250. (if !BaseConfig
  251.     (
  252.  
  253.     (set #basedir
  254.         (askstring
  255.             (prompt #basedir-prompt)
  256.             (default #def-basedir)
  257.             (help #Config-help)
  258.         )
  259.     )
  260.  
  261.     (complete 75)
  262.  
  263.     (set #maildir
  264.         (askstring
  265.             (prompt #maildir-prompt)
  266.             (default #def-maildir)
  267.             (help #Config-help)
  268.         )
  269.     )
  270.  
  271.     (complete 80)
  272.  
  273.     (set #editor
  274.         (askstring
  275.             (prompt #editor-prompt)
  276.             (default #def-editor)
  277.             (help #Config-help)
  278.         )
  279.     )
  280.  
  281.     (complete 85)
  282.  
  283.     (set #sendmail
  284.         (askstring
  285.             (prompt #sendmail-prompt)
  286.             (default #def-sendmail)
  287.             (help #Config-help)
  288.         )
  289.     )
  290.  
  291.     (complete 90)
  292.  
  293.     (textfile
  294.         (dest (cat "ENV:" "ADMail.config"))
  295.         (if (not (= #basedir #def-basedir))
  296.             (append (cat "BaseDir   \"" #basedir "\"\n"))
  297.         )
  298.         (if (not (= #maildir #def-maildir))
  299.             (append (cat "MBoxDir   \"" #maildir "\"\n"))
  300.         )
  301.         (if (not (= #editor #def-editor))
  302.             (append (cat "Editor   \"" #editor "\"\n"))
  303.         )
  304.         (if (not (= #sendmail #def-sendmail))
  305.             (append (cat "Sendmail   \"" #sendmail "\"\n"))
  306.         )
  307.     )
  308.  
  309.     (copyfiles
  310.         (prompt #Main-prompt)
  311.         (source (cat "ENV:" "ADMail.config"))
  312.         (dest "ENVARC:")
  313.     )
  314. ))
  315.  
  316. (complete 95)
  317.  
  318. (set !Makedir
  319.     (askbool
  320.         (prompt #makedir-prompt)
  321.         (help #Makedir-help)
  322.         (default 1)
  323.     )
  324. )
  325.  
  326. (set !user
  327.     (getenv "USER")
  328. )
  329.  
  330. (if (= !user "")
  331.     (set !user "user")
  332. )
  333.  
  334. (if !Makedir
  335.     (
  336.     (set !user
  337.         (askstring
  338.             (prompt #userid-prompt)
  339.             (default !user)
  340.             (help #Userid-help)
  341.         )
  342.     )
  343.  
  344.     (if (not (exists (tackon (tackon #basedir !user) "ADMail.config")))
  345.         (
  346.         (textfile
  347.             (dest (cat "T:" "ADMail.config"))
  348.             (append
  349.                 (cat "# " appname " configuration file.\n"
  350.                      "# Check " appname ".guide and fill in the options you need.\n"
  351.                 ))
  352.        )
  353.        (copyfiles
  354.             (prompt #Main-prompt)
  355.             (source (cat "T:" "ADMail.config"))
  356.             (dest (tackon #basedir !user))
  357.        )
  358.  
  359.        (delete
  360.             (dest (cat "T:" "ADMail.config"))
  361.        )
  362.  
  363.    ))
  364.  
  365.    (message (cat "\nUser directory: " (tackon #basedir !user) "\n"))
  366. ))
  367.  
  368. (complete 100)
  369.  
  370. ; == Exit =================================================================
  371.  
  372. (set #Exit-msg          (cat    "\nInstallation complete.\n\n\n"
  373.                                 "Location of program file:\n"
  374.                                 !MainLocation
  375.                                 "\n\nLocation of Document files:\n"
  376.                                 !DocLocation
  377.                                 "\n\n" ))
  378.  
  379. (message #Exit-msg)
  380.  
  381. (exit (quiet))
  382.  
  383.